<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var a = 100;
        function fn(){
            var b = 200;
            c = 300;
            console.log(a);
        }
        fn();

        //console.log(c);// c 是全局的c，所以可以输出
        //console.log(b);// b is not defined, 因为全局没有b

        // a 和 b是函数的形参，也是局部变量
        function fn123(a,b){
            console.log(a,b);
        }

        fn123(1,2);
        console.log(a,b);// a b is not defined;

    </script>
</body>
</html>